using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._SpatialAnalystTools._Generalization
{
    /// <summary>
    /// <para>Boundary Clean</para>
    /// <para>Smooths the boundary between zones in a raster.</para>
    /// <para>平滑栅格中区域之间的边界。</para>
    /// </summary>    
    [DisplayName("Boundary Clean")]
    public class BoundaryClean : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public BoundaryClean()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_raster">
        /// <para>Input raster</para>
        /// <para><xdoc>
        ///   <para>The input raster for which the boundary between zones will be smoothed.</para>
        ///   <para>It must be of integer type.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将平滑区域之间边界的输入栅格。</para>
        ///   <para>它必须是整数类型。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_out_raster">
        /// <para>Output raster</para>
        /// <para><xdoc>
        ///   <para>The output generalized raster.</para>
        ///   <para>The boundaries between zones in the input will be smoothed.</para>
        ///   <para>The output is always of integer type.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出广义栅格。</para>
        ///   <para>输入中区域之间的边界将被平滑。</para>
        ///   <para>输出始终为整数类型。</para>
        /// </xdoc></para>
        /// </param>
        public BoundaryClean(object _in_raster, object _out_raster)
        {
            this._in_raster = _in_raster;
            this._out_raster = _out_raster;
        }
        public override string ToolboxName => "Spatial Analyst Tools";

        public override string ToolName => "Boundary Clean";

        public override string CallName => "sa.BoundaryClean";

        public override List<string> AcceptEnvironments => ["autoCommit", "cellSize", "cellSizeProjectionMethod", "compression", "configKeyword", "extent", "geographicTransformations", "mask", "outputCoordinateSystem", "parallelProcessingFactor", "scratchWorkspace", "snapRaster", "tileSize", "workspace"];

        public override object[] ParameterInfo => [_in_raster, _out_raster, _sort_type.GetGPValue(), _number_of_runs.GetGPValue()];

        /// <summary>
        /// <para>Input raster</para>
        /// <para><xdoc>
        ///   <para>The input raster for which the boundary between zones will be smoothed.</para>
        ///   <para>It must be of integer type.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将平滑区域之间边界的输入栅格。</para>
        ///   <para>它必须是整数类型。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_raster { get; set; }


        /// <summary>
        /// <para>Output raster</para>
        /// <para><xdoc>
        ///   <para>The output generalized raster.</para>
        ///   <para>The boundaries between zones in the input will be smoothed.</para>
        ///   <para>The output is always of integer type.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出广义栅格。</para>
        ///   <para>输入中区域之间的边界将被平滑。</para>
        ///   <para>输出始终为整数类型。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_raster { get; set; }


        /// <summary>
        /// <para>Sort type</para>
        /// <para><xdoc>
        ///   <para>Specifies the type of sorting to use in the smoothing process. The sorting determines the priority by which cells can expand into their neighbors.</para>
        ///   <para>The sorting can be based on zone value or zone size.</para>
        ///   <bulletList>
        ///     <bullet_item>Do not sort—The priority is determined by zone value. The size of the zones is not considered. Zones with larger values will have a higher priority to expand into zones with smaller values in the smoothed output. This is the default.</bullet_item><para/>
        ///     <bullet_item>Descending—Zones are sorted in descending order by size. Zones with larger total areas have a higher priority to expand into zones with smaller total areas. This option tends to eliminate or reduce the prevalence of cells from smaller zones in the smoothed output.</bullet_item><para/>
        ///     <bullet_item>Ascending—Zones are sorted in ascending order by size. Zones with smaller total areas have a higher priority to expand into zones with larger total areas. This option tends to preserve or increase the prevalence of cells from smaller zones in the smoothed output.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定在平滑过程中使用的排序类型。排序决定了像元可以扩展到其相邻单元的优先级。</para>
        ///   <para>排序可以基于区域值或区域大小。</para>
        ///   <bulletList>
        ///     <bullet_item>不排序 - 优先级由区域值决定。不考虑区域的大小。在平滑输出中，具有较大值的区域将具有更高的优先级，以扩展到具有较小值的区域。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>降序 - 区域按大小降序排序。总面积较大的区域具有更高的优先级，可以扩展到总面积较小的区域。此选项倾向于消除或减少平滑输出中较小区域的像元的流行率。</bullet_item><para/>
        ///     <bullet_item>升序 - 区域按大小升序排序。总面积较小的区域具有更高的优先级，可以扩展到总面积较大的区域。此选项倾向于在平滑输出中保留或增加来自较小区域的细胞的流行率。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Sort type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _sort_type_value _sort_type { get; set; } = _sort_type_value._NO_SORT;

        public enum _sort_type_value
        {
            /// <summary>
            /// <para>Do not sort</para>
            /// <para>Do not sort—The priority is determined by zone value. The size of the zones is not considered. Zones with larger values will have a higher priority to expand into zones with smaller values in the smoothed output. This is the default.</para>
            /// <para>不排序 - 优先级由区域值决定。不考虑区域的大小。在平滑输出中，具有较大值的区域将具有更高的优先级，以扩展到具有较小值的区域。这是默认设置。</para>
            /// </summary>
            [Description("Do not sort")]
            [GPEnumValue("NO_SORT")]
            _NO_SORT,

            /// <summary>
            /// <para>Descending</para>
            /// <para>Descending—Zones are sorted in descending order by size. Zones with larger total areas have a higher priority to expand into zones with smaller total areas. This option tends to eliminate or reduce the prevalence of cells from smaller zones in the smoothed output.</para>
            /// <para>降序 - 区域按大小降序排序。总面积较大的区域具有更高的优先级，可以扩展到总面积较小的区域。此选项倾向于消除或减少平滑输出中较小区域的像元的流行率。</para>
            /// </summary>
            [Description("Descending")]
            [GPEnumValue("DESCEND")]
            _DESCEND,

            /// <summary>
            /// <para>Ascending</para>
            /// <para>Ascending—Zones are sorted in ascending order by size. Zones with smaller total areas have a higher priority to expand into zones with larger total areas. This option tends to preserve or increase the prevalence of cells from smaller zones in the smoothed output.</para>
            /// <para>升序 - 区域按大小升序排序。总面积较小的区域具有更高的优先级，可以扩展到总面积较大的区域。此选项倾向于在平滑输出中保留或增加来自较小区域的细胞的流行率。</para>
            /// </summary>
            [Description("Ascending")]
            [GPEnumValue("ASCEND")]
            _ASCEND,

        }

        /// <summary>
        /// <para>Run expansion and shrinking twice</para>
        /// <para><xdoc>
        ///   <para>Specifies the number of times the smoothing process will occur, twice or once.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—The expansion and shrinking operation is performed twice. The first time, the operation is performed according to the specified sort type. The second time, an additional expansion and shrinking operation is performed with the priority reversed. This is the default.</bullet_item><para/>
        ///     <bullet_item>Unchecked—The expansion and shrinking operation is performed once according to the sort type.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定平滑处理的次数，两次或一次。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 （Checked） - 执行两次扩展和收缩操作。第一次，根据指定的排序类型执行操作。第二次，在优先级颠倒的情况下执行额外的扩展和收缩操作。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>未选中 - 根据排序类型执行一次展开和收缩操作。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Run expansion and shrinking twice")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _number_of_runs_value _number_of_runs { get; set; } = _number_of_runs_value._true;

        public enum _number_of_runs_value
        {
            /// <summary>
            /// <para>TWO_WAY</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("TWO_WAY")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>ONE_WAY</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("ONE_WAY")]
            [GPEnumValue("false")]
            _false,

        }

        public BoundaryClean SetEnv(int? autoCommit = null, object cellSize = null, object compression = null, object configKeyword = null, object extent = null, object geographicTransformations = null, object mask = null, object outputCoordinateSystem = null, object parallelProcessingFactor = null, object scratchWorkspace = null, object snapRaster = null, double[] tileSize = null, object workspace = null)
        {
            base.SetEnv(autoCommit: autoCommit, cellSize: cellSize, compression: compression, configKeyword: configKeyword, extent: extent, geographicTransformations: geographicTransformations, mask: mask, outputCoordinateSystem: outputCoordinateSystem, parallelProcessingFactor: parallelProcessingFactor, scratchWorkspace: scratchWorkspace, snapRaster: snapRaster, tileSize: tileSize, workspace: workspace);
            return this;
        }

    }

}